﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TodayWhoModel;

namespace TodayWho.adm
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            AdminModel adminInfo = new AdminModel();
            bool res = adminInfo.CheckLogin(txtMail.Text, txtPassword.Text);
            if (!res)
            {
                statusLabel.Visible = true;
            }
            else
            {
                Session.Add("isAdmin", true);
                Session.Add("adminEmail", adminInfo.Email);
                Response.Redirect("notcontrolled.aspx");
            }

        }
    }
}